﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SearchEF
{
    public class GenericEqualityComparer<T> : IEqualityComparer<T>
    {
        private Func<T, T, bool> equateFunc;
        public GenericEqualityComparer(Func<T, T, bool> equateFunc) { this.equateFunc = equateFunc; }
        public bool Equals(T x, T y)
        {
            if (this.equateFunc != null)
                return this.equateFunc(x, y);
            return false;
        }
        public int GetHashCode(T obj) { return base.GetHashCode(); }
    }
}
